import React from "react"
import { Collapse,Checkbox  } from "antd"
import styles from './MoreSelect_new.less'
const Panel = Collapse.Panel
const CheckboxGroup = Checkbox.Group

class MoreSelect_new extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      checkedValues:'',
      children:[],
    }
  }

  componentDidMount () {
  }

  onChange=(checkedValues)=>{
    this.setState({
      checkedValues:checkedValues,
    })
    this.props.handleChange(checkedValues)
  }


  render () {
    // const { getFieldDecorator } = this.props.form
    const { checkedValues} = this.state
    const {children}=this.props
  
    return (
      <div className={styles.collapse}>
      <Collapse >
          <Panel header={checkedValues.length>0?checkedValues+',':<span style={{color:'#e5e5e5'}}>请选择</span>} key="1">
            <CheckboxGroup options={children} onChange={this.onChange} />
          </Panel>
      </Collapse>
      </div>

  )
  }
}
// const MoreSelect_news=Form.create()(MoreSelect_new)
export default MoreSelect_new
